<?php

namespace App\Services\Account;

use Illuminate\Database\Eloquent\Relations\HasMany;

class AccountGoldSubsidies extends AccountAbstract
{
	protected function account(): HasMany
    {
        return $this->user->goldSubsidies();
    }

    /*---------- plus --------------------------------------------------------------------------------------------------*/

    public function plusInitialSubsidies($money, $data = [])
    {
        $money = big_decimal($money);
        $this->record($money, 'init_gold_subsidies', '初始补贴金', $data);
    }

    public function plusPresentSubsidies($money, $data = [])
    {
        $money = big_decimal($money);
        $this->record($money, 'present_gold_cashes', '平台赠送补贴金', $data);
    }

    /*---------- minus -------------------------------------------------------------------------------------------------*/

    public function minusUnlockedSubsidise($money, $data = [])
    {
        $money = big_decimal($money)->multipliedBy(-1);
        $this->record($money, 'unlocked_gold_subsidies', '解锁补贴金', $data);
    }

    public function minusSystemRecall($money, $data = [])
    {
        $money = big_decimal($money)->multipliedBy(-1);
        $this->record($money, 'system_recall', '系统回收', $data);
    }
}
